package com.mxpio.erp.common.jpa.model;

import java.math.BigDecimal;

import javax.persistence.*;

import com.mxpio.erp.common.inventory.entity.SupplyChain;
import com.mxpio.erp.common.technology.entity.Item;
import com.mxpioframework.security.annotation.Dict;
import com.mxpioframework.security.entity.BaseEntity;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 通知单明细
 * @author MxpIO
 */
@Data
@MappedSuperclass
@EqualsAndHashCode(callSuper=false)
@IdClass(NoticeLineKey.class)
public class NoticeLine extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /*@EmbeddedId
	private BizNoticeLineKey id;*/

    @Column(name = "LINE_NO_", updatable = false)
    @Schema(description = "行号")
    @Id
    private String lineNo;

    @Column(name = "NOTICE_NO_", updatable = false)
    @Schema(description = "通知单号")
    @Id
    private String noticeNo;
    
    @Column(name = "ORIGIN_BIZ_NO_")
	@Schema(description = "来源单号")
	private String originBizNo;
    
    @Column(name = "ORIGIN_BIZ_LINE_NO_")
	@Schema(description = "来源单行号")
	private String originBizLineNo;

	@Column(name = "SORT_")
	@Schema(description = "顺序号")
	private String sort;

    @Column(name = "ITEM_CODE_")
    @Schema(description = "物料编码")
    private String itemCode;
    
    @Column(name = "ITEM_NAME_")
	@Schema(description = "物料名称")
	private String itemName ;

	@Column(name = "ITEM_SPEC_")
	@Schema(description = "规格型号")
	private String itemSpec;
	
	@Column(name = "UNIT_CODE_")
    @Schema(description = "单位编号")
	@Dict(dicCode="ERP_TECH_UNIT_CODE")
    private String unitCode;
    
    @Column(name = "LOT_NO_")
	@Schema(description = "批次号")
	private String lotNo;

    @Column(name = "SUB_LOT_INDEX_")
    @Schema(description = "子批次索引号")
    private String subLotIndex;

    @Column(name = "QUANTITY_")
    @Schema(description = "数量")
    private BigDecimal quantity;

    @Column(name = "DRAWING_NO_")
    @Schema(description = "图号")
    private String drawingNo;

    @Transient
    @Schema(description = "确认数量")
    private BigDecimal woLineQuantity;

    @Transient
    private Notice notice;

    @Transient
    private Item item;

    @Transient
    private SupplyChain supplyChain;
}
